package String;

public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder("start");
        System.out.println(sb);

        //增加/拼接
        System.out.println( sb.append(true).append(123));

        //替换 replace(index start, index end, String str)
        System.out.println(sb.replace(0,5,"开始"));

        //反转reverse
        System.out.println(sb.reverse());
        System.out.println(sb.reverse());

        //删除
        System.out.println(sb.delete(0,2));

        //插入
        System.out.println(sb.insert(4,"开始"));
        
    }
}
